import 'package:getx_demo/common/apis/apis.dart';
import 'package:getx_demo/common/entities/entities.dart';
import 'package:get/get.dart';

class UserinfoController extends GetxController {
  UserinfoController();
  // final userInfo = ErdsUserStore.to.userInfo!;
  UserBaseInfo? baseInfo;
  _initData() {
    update(["userinfo"]);
  }

  void onTap() {}

  void getUserBaseInfo() async {
    var response = await UserRequest.getUserBaseInfo();
    if (response != null) {
      baseInfo = UserBaseInfo.fromJson(response.result);
      _initData();
    }
  }

  @override
  void onInit() {
    super.onInit();
    getUserBaseInfo();
  }

  @override
  void onReady() {
    super.onReady();
    _initData();
  }

  // @override
  // void onClose() {
  //   super.onClose();
  // }
}
